<div class="col-lg-12">
    <h1 class="page-header">Đơn hàng</h1>
</div>
<div class="col-lg-12">
    <table class="items table table-bordered">
        <tr style="background: #428bca;color: #fff">
            <th width="100">Mã ĐH</th>
            <th width="150">Người mua</th>
            <th width="150">Số điện thoại</th>
            <th>Tổng giá</th>
            <th width="150">tình trạng</th>
            <th>Ngày tạo</th>
            <th width="100">Xem</th>
            
        </tr>
        <?php $form = $this->beginWidget('booster.widgets.TbActiveForm',
                array(
                    'id' => 'verticalForm',
                    'method' => 'get',
                    'htmlOptions' => array('method' => 'get'), // for inset effect
                )); 
        ?>
        <tr class="container-search">
                <td>
                    <?php
                        echo $form->textFieldGroup($orderSearch, 'order_id',array('labelOptions' => array("label" => false)));
                    ?>
                </td>
                <td>
                    <?php
                        echo $form->textFieldGroup($orderSearch, 'payment_name',array('labelOptions' => array("label" => false)));
                    ?>
                </td>
                
                <td>
                    <?php
                        echo $form->textFieldGroup($orderSearch, 'payment_phone',array('labelOptions' => array("label" => false)));
                    ?>
                </td>
                <td></td>
                <td>
                    <?php
                    $status_search = $arrayStatus;
                    $status_search[0] = 'tất cả';
                    ksort($status_search);
                    echo $form->dropDownListGroup(
                            $orderSearch, 'status', array(
                                'labelOptions' => array("label" => false),
                                'widgetOptions' => array(
                                    'data' => $status_search,
                                )
                             )
                    );
                    ?>
                </td>
                <td>
                    
                </td>
                <td >
                    <input  value="tìm kiếm" class="btn btn-danger" type="submit"/>
                </td>
        </tr>
        <?php $this->endWidget(); ?>
        <?php foreach($orders as $order):?>
        <tr>
            <td><?php echo $order->order_id?></td>
            <td><?php echo $order->payment_name?></td>
            <td><?php echo $order->payment_phone?></td>
            <td><?php echo number_format($order->total,0,0,'.')?> VNĐ</td>
            <td>
                <?php echo isset($arrayStatus[$order->status])?$arrayStatus[$order->status]:"";?>
            </td>
            <td>
                <?php echo date('d-m-Y H:i:s',  strtotime($order->created))?>
            </td>
            <td style="text-align: center">
                <a class="view" title="" data-toggle="tooltip" href="<?php echo Yii::app()->createUrl('Order/view',array('id' => $order->order_id))?>" data-original-title="View"><i class="glyphicon glyphicon-eye-open"></i></a>
                
            </td>
        </tr>
        <?php endforeach;?>
        
    </table>
    <?php $this->widget('CLinkPager', array(
                    'pages' => $pages,
                    'prevPageLabel'=>'<<',
                    'nextPageLabel'=>'>>',
                    'header'=>'',
                    'lastPageLabel' => 'Sau cùng',
                    'firstPageLabel' => 'Đầu tiên',
                    'htmlOptions'=>array('class'=>'pagination')
        )); 
    ?>
</div>